package iwpl.teky.sample.entities;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Categories entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "Categories")
public class Categories implements java.io.Serializable {

	// Fields

	private Integer categoryId;
	private String categoryName;
	private Boolean status;
	private Set<News> newses = new HashSet<News>(0);
	private Set<News> newses_1 = new HashSet<News>(0);

	// Constructors

	/** default constructor */
	public Categories() {
	}

	/** minimal constructor */
	public Categories(Integer categoryId, String categoryName, Boolean status) {
		this.categoryId = categoryId;
		this.categoryName = categoryName;
		this.status = status;
	}

	/** full constructor */
	public Categories(Integer categoryId, String categoryName, Boolean status,
			Set<News> newses, Set<News> newses_1) {
		this.categoryId = categoryId;
		this.categoryName = categoryName;
		this.status = status;
		this.newses = newses;
		this.newses_1 = newses_1;
	}

	// Property accessors
	@Id
	@GeneratedValue
	@Column(name = "CategoryID", unique = true, nullable = false)
	public Integer getCategoryId() {
		return this.categoryId;
	}

	public void setCategoryId(Integer categoryId) {
		this.categoryId = categoryId;
	}

	@Column(name = "CategoryName", nullable = false)
	public String getCategoryName() {
		return this.categoryName;
	}

	public void setCategoryName(String categoryName) {
		this.categoryName = categoryName;
	}

	@Column(name = "Status", nullable = false)
	public Boolean getStatus() {
		return this.status;
	}

	public void setStatus(Boolean status) {
		this.status = status;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "categories")
	public Set<News> getNewses() {
		return this.newses;
	}

	public void setNewses(Set<News> newses) {
		this.newses = newses;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "categories")
	public Set<News> getNewses_1() {
		return this.newses_1;
	}

	public void setNewses_1(Set<News> newses_1) {
		this.newses_1 = newses_1;
	}

}